//package org.dromara.system.controller.system;
//
//import cn.dev33.satoken.annotation.SaCheckPermission;
//import jakarta.servlet.http.HttpServletResponse;
//import jakarta.validation.constraints.NotEmpty;
//import jakarta.validation.constraints.NotNull;
//import lombok.RequiredArgsConstructor;
//import org.dromara.common.core.domain.R;
//import org.dromara.common.core.validate.AddGroup;
//import org.dromara.common.core.validate.EditGroup;
//import org.dromara.common.excel.utils.ExcelUtil;
//import org.dromara.common.idempotent.annotation.RepeatSubmit;
//import org.dromara.common.log.annotation.Log;
//import org.dromara.common.log.enums.BusinessType;
//import org.dromara.common.mybatis.core.page.PageQuery;
//import org.dromara.common.mybatis.core.page.TableDataInfo;
//import org.dromara.common.web.core.BaseController;
//import org.dromara.system.domain.bo.BindMachineBo;
//import org.dromara.system.domain.bo.QueryBindMachineBo;
//import org.dromara.system.domain.bo.SysUserMachineAssociationBo;
//import org.dromara.system.domain.vo.SysUserMachineAssociationVo;
//import org.dromara.system.service.ISysUserMachineAssociationService;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//
///**
// * 商户绑定机器关系
// *
// * @author Lion Li
// * @date 2025-07-03
// */
//@Validated
//@RequiredArgsConstructor
//@RestController
//@RequestMapping("/system/userMachineAssociation")
//public class SysUserMachineAssociationController extends BaseController {
//
//    private final ISysUserMachineAssociationService sysUserMachineAssociationService;
//
//    /**
//     * 查询商户绑定机器关系列表
//     */
////    @SaCheckPermission("system:userMachineAssociation:list")
//    @GetMapping("/list")
//    public TableDataInfo<SysUserMachineAssociationVo> list(SysUserMachineAssociationBo bo, PageQuery pageQuery) {
//        return sysUserMachineAssociationService.queryPageList(bo, pageQuery);
//    }
//
//    /**
//     * 导出商户绑定机器关系列表
//     */
////    @SaCheckPermission("system:userMachineAssociation:export")
//    @Log(title = "商户绑定机器关系", businessType = BusinessType.EXPORT)
//    @PostMapping("/export")
//    public void export(SysUserMachineAssociationBo bo, HttpServletResponse response) {
//        List<SysUserMachineAssociationVo> list = sysUserMachineAssociationService.queryList(bo);
//        ExcelUtil.exportExcel(list, "商户绑定机器关系", SysUserMachineAssociationVo.class, response);
//    }
//
//    /**
//     * 获取商户绑定机器关系详细信息
//     *
//     * @param id 主键
//     */
////    @SaCheckPermission("system:userMachineAssociation:query")
//    @GetMapping("/{id}")
//    public R<SysUserMachineAssociationVo> getInfo(@NotNull(message = "主键不能为空")
//                                                  @PathVariable Long id) {
//        return R.ok(sysUserMachineAssociationService.queryById(id));
//    }
//
//    /**
//     * 新增商户绑定机器关系
//     */
////    @SaCheckPermission("system:userMachineAssociation:add")
//    @Log(title = "商户绑定机器关系", businessType = BusinessType.INSERT)
//    @RepeatSubmit()
//    @PostMapping()
//    public R<Void> add(@Validated(AddGroup.class) @RequestBody SysUserMachineAssociationBo bo) {
//        return toAjax(sysUserMachineAssociationService.insertByBo(bo));
//    }
//
//    /**
//     * 修改商户绑定机器关系
//     */
////    @SaCheckPermission("system:userMachineAssociation:edit")
//    @Log(title = "商户绑定机器关系", businessType = BusinessType.UPDATE)
//    @RepeatSubmit()
//    @PutMapping()
//    public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysUserMachineAssociationBo bo) {
//        return toAjax(sysUserMachineAssociationService.updateByBo(bo));
//    }
//
//    /**
//     * 删除商户绑定机器关系
//     *
//     * @param ids 主键串
//     */
////    @SaCheckPermission("system:userMachineAssociation:remove")
//    @Log(title = "商户绑定机器关系", businessType = BusinessType.DELETE)
//    @DeleteMapping("/{ids}")
//    public R<Void> remove(@NotEmpty(message = "主键不能为空")
//                          @PathVariable Long[] ids) {
//        return toAjax(sysUserMachineAssociationService.deleteWithValidByIds(List.of(ids), true));
//    }
//
//
////    @SaCheckPermission("system:userMachineAssociation:bindMachine")
//    @Log(title = "商户绑定机器", businessType = BusinessType.OTHER)
//    @PostMapping("/bindMachine")
//    public R<Void> bindMachine(@RequestBody BindMachineBo bindMachineBo) {
//        return toAjax(sysUserMachineAssociationService.bindMachine(bindMachineBo));
//    }
//
////    @SaCheckPermission("system:userMachineAssociation:unBindMachine")
//    @Log(title = "商户解绑机器", businessType = BusinessType.OTHER)
//    @PostMapping("/unBindMachine")
//    public R<Void> unBindMachine(@RequestBody BindMachineBo bindMachineBo) {
//        return toAjax(sysUserMachineAssociationService.unBindMachine(bindMachineBo));
//    }
//
////    @SaCheckPermission("system:userMachineAssociation:queryBindMachine")
//    @Log(title = "查询商户绑定的机器列表", businessType = BusinessType.OTHER)
//    @GetMapping("/queryBindMachine")
//    public TableDataInfo<SysUserMachineAssociationVo> queryBindMachine( QueryBindMachineBo queryBindMachineBo,PageQuery pageQuery) {
//        return sysUserMachineAssociationService.queryBindMachine(queryBindMachineBo,pageQuery);
//    }
//
//}
